<?php
/**
 * database.php
 * 
 * @author:   Skiychan<developer@zzzzy.com>
 * @created:  2/5/15 17:30
 * @modified: 
 */


if ($_SERVER["SERVER_NAME"] == '127.0.0.1') {
    $dbh = new PDO('mysql:host=localhost;dbname=stock', 'root', '123456');
    $tb_name = "tbl_stock_price_for_chart";
} else {
    $dbh = new PDO('mysql:host=116.255.150.169;port=4002;dbname=zzzzy', 'zzzzy_f', '123456');
    $tb_name = "tbl_stock_price_for_chart";
}

$dbh->exec("SET NAMES 'utf8';");  //转编码为utf8